import {
	formatDate
} from "./time.js"
// 数字过万的处理
const formartNum = (val) => {
	let num = 0
	if (val > 9999) {
		num = Math.round(val / 10000 * 10) / 10 + '万'
	} else {
		num = val
	}
	return num
}
//处理歌词时间
const formatLyricTime = (time) => {
	// 格式化歌词的时间 转换成 sss:ms
	const regMin = /.*:/;
	const regSec = /:.*\./;
	const regMs = /\./;
	const min = parseInt(time.match(regMin)[0].slice(0, 2));
	let sec = parseInt(time.match(regSec)[0].slice(1, 3));
	const ms = time.slice(time.match(regMs).index + 1, time.match(regMs).index + 3);
	if (min !== 0) {
		sec += min * 60;
	}
	return Number(sec + '.' + ms);
}
const albumSong = () => {
	let abcd = 100;
	let s = "dasdas"
	let array = {
		id: abcd,
		c: s
	}
	return array
}
const songitems = (items) => {
	console.log(items)
}
const songindex = (index) => {

}
const currentmsg = (items) => {
	let currentobj = {
		name: items.name,
		picUrl: items.al.picUrl
	}
	return currentobj
}
export const foot = "sss"
export {
	formartNum,
	formatLyricTime,
	albumSong,
	songitems,
	songindex,
	currentmsg

}
